<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta name="viewport" content="width=320; user-scalable=no" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>LiquidGear</title>
	  <link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" title="no title" charset="utf-8">
	  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
	  <script type="text/javascript" charset="utf-8" src="js/lg_iphone.js"></script>
	  <script type="text/javascript" charset="utf-8">
		
		$(document).ready(init);
		
	  var preventBehavior = function(e) { 
      e.preventDefault();
    }
		
		function init(){
		  document.addEventListener("touchmove", preventBehavior, false);
		  deviceInfo();
		}
		
    function deviceInfo(){
      $("#platform").html(Device.name);
      $("#version").html(Device.version);
      $("#appVersion").html(Device.appVersion);
      $("#uid").html(Device.id);
			
			$("#btnAlert").click(alert);
			$("#btnBeep").click(beep);
			$("#btnAllContacts").click(getAllContacts);
			$("#btnContact").click(getContact);
    }
		
    function alert(e){
			$.notify.alert('this is a test');
    }
    function beep(e){
	    $.notify.beep();
    }
    function getAllContacts(e){
			$.contacts.all();
    }
    function getContact(e){
			$.contacts.email('hank-zakroff@mac.com');
    }
		/*
    var getLocation = function() {
      var suc = function(p){
		    alert(p.latitude + " " + p.longitude);
      };
      var fail = function(){};
      lg.geolocation.getCurrentPosition(suc,fail);
    }
    
	
	
  	var getContact = function(){
  	  var suc = function(c){ alert("Contact 4: " + c.contacts[3].name); };
  		var fail = function(){};
  		lg.ContactManager.get(suc, fail);
  	}
  	
  	var startAccel = function() {
  		var suc = function(p){
  			alert("Accelerator is Started!\n You can now watch it");
  		};
  		var fail = function(){};
  		lg.accelerometer.getCurrentAcceleration(suc,fail);
  	}
  	
  	var watchAccel = function() {
  		var suc = function(a){
  			document.getElementById('x').innerHTML = roundNumber(a.x);
  			document.getElementById('y').innerHTML = roundNumber(a.y);
  			document.getElementById('z').innerHTML = roundNumber(a.z);
  		};
  		var fail = function(){};
  		var opt = {};
  		opt.frequency = 100;
  		timer = lg.accelerometer.watchAcceleration(suc,fail,opt);
  	}
    	
    function roundNumber(num) {
      var dec = 3;
      var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
      return result;
    }
    
		*/
	  </script>
  </head>
  <body id="stage" class="theme">
    <h1>Next Page</h1>
    <h2>This file is located at iphone/www/index.html</h2>
    <div id="info">
      <h4>Platform: <span id="platform">&nbsp;</span></h4>
      <h4>Version: <span id="version">&nbsp;</span></h4>
      <h4>App Version: <span id="appVersion">&nbsp;</span></h4>
      <h4>UID: <span id="uid">&nbsp;</span></h4>
    </div>
    <dl id="accel-data">
      <dt>X:</dt><dd id="x">&nbsp;</dd>
      <dt>Y:</dt><dd id="y">&nbsp;</dd>
      <dt>Z:</dt><dd id="z">&nbsp;</dd>
    </dl>
    <a href="#" class="btn" onclick="startAccel();">Start Accelerometer</a>
    <a href="#" class="btn" onclick="watchAccel();">Watch Accelerometer</a>
    <a href="#" class="btn large" onclick="getLocation();">Get Location</a>
    <div id="btnBeep" class="btn">Beep</div>
    <div id="btnAlert" class="btn">Alert</div>
    <a href="#" class="btn large" onclick="vibrate();">Vibrate</a>
    <div id="btnAllContacts" class="btn">Get All Contacts</div>
    <div id="btnContact" class="btn">Get Contact</div>
  </body>
</html>